package ca.venasse.pinventory.config;

import org.axonframework.eventhandling.EventBus;
import org.axonframework.eventsourcing.GenericEventSourcingRepository;
import org.axonframework.eventstore.EventStore;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import ca.venasse.pinventory.part.domain.Part;

@Configuration
public class PartConfiguration {

	@Bean
	public GenericEventSourcingRepository<Part> inspectionRepository(EventBus eventBus,
			EventStore eventStore) {
		GenericEventSourcingRepository<Part> repository = new GenericEventSourcingRepository<Part>(
			Part.class);
		repository.setEventBus(eventBus);
		repository.setEventStore(eventStore);
		return repository;
	}
}
